<%@ page import="com.mastercard.Budget" %>



<div class="fieldcontain ${hasErrors(bean: budgetInstance, field: 'amount', 'error')} required">
	<label for="amount">
		<g:message code="budget.amount.label" default="Amount" />
		<span class="required-indicator">*</span>
	</label>
	<g:field type="number" name="amount" required="" value="${fieldValue(bean: budgetInstance, field: 'amount')}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: budgetInstance, field: 'creditCard', 'error')} required">
	<label for="creditCard">
		<g:message code="budget.creditCard.label" default="Credit Card" />
		<span class="required-indicator">*</span>
	</label>
	<g:select id="creditCard" name="creditCard.id" from="${com.mastercard.CreditCard.list()}" optionKey="id" required="" value="${budgetInstance?.creditCard?.id}" class="many-to-one"/>
</div>

<div class="fieldcontain ${hasErrors(bean: budgetInstance, field: 'currency', 'error')} ">
	<label for="currency">
		<g:message code="budget.currency.label" default="Currency" />
		
	</label>
	<g:textField name="currency" value="${budgetInstance?.currency}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: budgetInstance, field: 'description', 'error')} ">
	<label for="description">
		<g:message code="budget.description.label" default="Description" />
		
	</label>
	<g:textField name="description" value="${budgetInstance?.description}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: budgetInstance, field: 'endDate', 'error')} required">
	<label for="endDate">
		<g:message code="budget.endDate.label" default="End Date" />
		<span class="required-indicator">*</span>
	</label>
	<g:datePicker name="endDate" precision="day"  value="${budgetInstance?.endDate}"  />
</div>

<div class="fieldcontain ${hasErrors(bean: budgetInstance, field: 'level', 'error')} required">
	<label for="level">
		<g:message code="budget.level.label" default="Level" />
		<span class="required-indicator">*</span>
	</label>
	<g:select name="level" from="${com.mastercard.Budget$Level?.values()}" keys="${com.mastercard.Budget$Level.values()*.name()}" required="" value="${budgetInstance?.level?.name()}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: budgetInstance, field: 'recursive', 'error')} ">
	<label for="recursive">
		<g:message code="budget.recursive.label" default="Recursive" />
		
	</label>
	<g:checkBox name="recursive" value="${budgetInstance?.recursive}" />
</div>

<div class="fieldcontain ${hasErrors(bean: budgetInstance, field: 'startDate', 'error')} required">
	<label for="startDate">
		<g:message code="budget.startDate.label" default="Start Date" />
		<span class="required-indicator">*</span>
	</label>
	<g:datePicker name="startDate" precision="day"  value="${budgetInstance?.startDate}"  />
</div>

<div class="fieldcontain ${hasErrors(bean: budgetInstance, field: 'type', 'error')} required">
	<label for="type">
		<g:message code="budget.type.label" default="Type" />
		<span class="required-indicator">*</span>
	</label>
	<g:select name="type" from="${com.mastercard.Budget$Type?.values()}" keys="${com.mastercard.Budget$Type.values()*.name()}" required="" value="${budgetInstance?.type?.name()}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: budgetInstance, field: 'user', 'error')} required">
	<label for="user">
		<g:message code="budget.user.label" default="User" />
		<span class="required-indicator">*</span>
	</label>
	<g:select id="user" name="user.id" from="${com.mastercard.auth.User.list()}" optionKey="id" required="" value="${budgetInstance?.user?.id}" class="many-to-one"/>
</div>

